﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using TjZheng.Framework;

namespace TjZheng.Example.MVC.Controllers
{
    public class CookieController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult WriteCookie()
        {
            CookieHelper.SetCookieValue("Test", "TjZheng", DateTime.Now.AddMinutes(5));
            return Content("设置成功,Cookie值：" + CookieHelper.GetCookieValue("TjZheng"));
        }

        public ActionResult GetCookie()
        {
            return Content(CookieHelper.GetCookieValue("TjZheng"));
        }
    }
}
